import axios from './request'

// 获取bannerAPI
export const GetHomeAPI = () => axios.get('/index/index');

// 搜索窗口数据  /search/index
export const GetHisHotAPI = () => axios.get('/search/index');

// 实时搜索功能  /search/helper
/* export const GetSearchListAPI = (keyword) => axios.get('/search/helper', {
  params: {
    keyword
  }
}); */

export const GetSearchListAPI = (params) => axios.get('/search/helper', {params});

// 搜索框商品搜索 /goods/list
export const GetProductListAPI = (params) => axios.get('/goods/list', {params});

// 清除历史记录 /search/clearhistory
export const ClearHistoryAPI = () => axios.post('/search/clearhistory');

// 登录接口（没有账号自动注册） /auth/loginByWeb
export const UserLoginAPI = (params) => axios.post('/auth/loginByWeb', params);

// 产品明细 /goods/detail
export const GetProductDetailAPI = (params) => axios.get('/goods/detail', {params});

// 相关产品 /goods/related
export const GetProductRelativeAPI = (params) => axios.get('/goods/related', {params});

// 获取购物车产品数量  /cart/goodscount
export const GetGoodsCountAPI = () => axios.get('/cart/goodscount');

// 加入购物车 /cart/add
export const AddToCartAPI = (params) => axios.post('/cart/add', params);

// 获取购物车数据（含完成编辑） /cart/index
export const GetCartAPI = () => axios.get('/cart/index');

// 点击切换商品选中状态（含全选） /cart/checked
export const ChanGoodsCheckAPI = (params) => axios.post('/cart/checked', params);

// 商品步进器 /cart/update
export const ChanStepNumAPI = (params) => axios.post('/cart/update', params);

// 删除商品 /cart/delete
export const DelGoodsAPI = (params) => axios.post('/cart/delete', params);